/*
 * @Date: 2023-12-22 11:17:07
 * @LastEditors: lyx
 * @LastEditTime: 2023-12-22 11:20:14
 * @FilePath: \taro-template3\src\components\BaseOverlay\index.tsx
 * @Description: 基础全局loading遮罩层
 */
import { Loading, Overlay } from "@nutui/nutui-react-taro";

const DEFAULT_WRAPPER_STYLE = {
  display: "flex",
  height: "100%",
  alignItems: "center",
  justifyContent: "center",
};
function BaseOverlay(props: IBaseOverlay) {
  const {
    visible,
    text = "加载中",
    WrapperStyle = DEFAULT_WRAPPER_STYLE,
  } = props;
  return (
    <Overlay visible={visible}>
      <div className="wrapper" style={WrapperStyle}>
        <Loading direction="vertical">{text}</Loading>
      </div>
    </Overlay>
  );
}

export default BaseOverlay;
